home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
comm
/
tcp
/
Netdial4_0.lha
/
AmiTCP_Netdial4.0
/
RXSER502.LHA
/
testrecv.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-04-27
|
1KB
|
46 lines
/* part of another serial port test program. */
/* works best when connected to another computer via a null modem. */
/* first run testrecv in a one CLI; then run testsend in another CLI. */
/* open the Rexx support library */
signal on error
if ~show('L',"rexxsupport.library") then do
if addlib('rexxsupport.library',0,-30,0) then
say 'added rexxsupport.library'
else do;
say 'support library not available'
exit 10
end
end
if ~show( 'L', "rexxserdev.library" ) then do
if addlib( 'rexxserdev.library', 0, -30, 0 ) then
say 'added rexxserdev.library'
else do;
say 'support library not available'
exit 10
end
end
libaddr = serlibbase()
say 'serial library base =' libaddr
dh = seropen( 'serial.device', 0 )
if dh = "" then say 'serial device not opened'
if serreset( dh ) then say 'serial device reset'
if ~sersetparms( dh, 9600, 8, 'N', 1 ) then say 'Parms not set'
if ~serclear( dh ) then say 'buffer not clear'
block = allocmem( 80 )
addr = c2d( block )
say 'memory block address =' addr
say "send a '~' to end"
do until text = '~'
query = SerQuery( dh )
parse var query err rl stat
if rl > 0 then do; text = SerRead( dh, addr, rl ); call writech STDOUT, text; end;
end
if ~freemem( block, 80 ) then say 'memory block not freed'
error:
if serclose( dh ) then say 'serial device closed'
exit(0)